Skip to content

Conversation

@nvborisenko
Copy link
Member

@nvborisenko nvborisenko commented Aug 4, 2025

User description

Currently default internal logging level is Info, meaning that all log messages with Info, Warn, Error levels go to user's output by default. It doesn't look rational when we speak about the library should be silent as possible.

Warning and Errors are OK to be revealed by default, meaning "hey dear user, please pay attention". But it doesn't make sense for Info level. Now it is clear why Selenium has no Info messages at all.

🔗 Related Issues

Contributes to #15785

💥 What does this PR do?

Change default internal logging level.

🔄 Types of changes

  • Cleanup (formatting, renaming)
  • Bug fix (backwards compatible)

PR Type

Other


Description

  • Change default internal log level from Info to Warn

  • Reduce verbosity of library output by default

  • Keep warnings and errors visible to users


Diagram Walkthrough

flowchart LR
  A["LogContextManager"] --> B["Default Log Level"]
  B --> C["Info Level"] 
  B --> D["Warn Level"]
  C -.-> D
  D --> E["Less Verbose Output"]
Loading

File Walkthrough

Relevant files
Configuration changes
LogContextManager.cs
Update default log level configuration                                     

dotnet/src/webdriver/Internal/Logging/LogContextManager.cs

  • Modified LogContextManager constructor to use LogEventLevel.Warn
    instead of LogEventLevel.Info
  • Changed default logging behavior to be less verbose
+1/-1     

@selenium-ci selenium-ci added the C-dotnet .NET Bindings label Aug 4, 2025
@qodo-merge-pro
Copy link
Contributor

qodo-merge-pro bot commented Aug 4, 2025

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis ✅

15785 - PR Code Verified

Compliant requirements:

• Reduce default console output from the library
• Make library less verbose by default

Requires further human verification:

• Verify that warnings and errors are still appropriately visible to users
• Test that this change doesn't break existing applications that rely on Info level logs
• Confirm that users can still enable Info level logging when needed

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Breaking Change

Changing the default log level from Info to Warn could be a breaking change for applications that depend on Info level messages being visible by default. This should be documented and considered for version compatibility.

    GlobalContext = new LogContext(LogEventLevel.Warn, null, null, [defaulLogHandler]);
}

@qodo-merge-pro
Copy link
Contributor

qodo-merge-pro bot commented Aug 4, 2025

PR Code Suggestions ✨

No code suggestions found for the PR.

@nvborisenko
Copy link
Member Author

Now Info log level can be used internally without any impact.

@nvborisenko nvborisenko merged commit 7d0646a into SeleniumHQ:trunk Aug 4, 2025
13 checks passed
@nvborisenko nvborisenko deleted the dotnet-default-internal-log-level branch August 4, 2025 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants